import { createRouter, createWebHistory } from 'vue-router'
import homeRouter from './homeRouter'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path:'/',
      redirect:'/login'
    },
    {
      // 信息管理
      path: '/home',
      name: 'home',
      component: () => import('@/views/Home/index.vue'),
      children: [...homeRouter]
    },
    {
      // 信息管理
      path: '/terminal',
      name: 'terminal',
      component: () => import('@/views/Terminal/index.vue'),
      // children: [...homeRouter]
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/Login/index.vue')
    },
    {
      path: '/dataCenter',
      name: 'dataCenter',
      component: () => import('@/views/DataCenter/index.vue')
    },
    {
      // 支付宝沙箱
      path: '/payment',
      name: 'payment',
      component: () => import('@/views/Payment/index.vue')
    },
    // 404
    {
      path: '/:cachAlll(.*)',
      component: () => import('@/components/common/404.vue')
    }
  ]
})

export default router
